package com.webapp.blog.web.service.impl;
import com.webapp.blog.core.generic.GenericDao;
import com.webapp.blog.core.generic.GenericServiceImpl;
import com.webapp.blog.web.dao.BlogMapper;
import com.webapp.blog.web.model.Blog;
import com.webapp.blog.web.model.User;
import com.webapp.blog.web.service.BlogService;
import org.springframework.stereotype.Service;
import javax.annotation.Resource;
import java.util.List;

/**
 * blog 实现类
 *
 * @author James
 * @since 2016年8月14日 下午3:54:00
 */
@Service
public class BlogServiceImpl extends GenericServiceImpl<Blog, Long> implements BlogService {

    @Resource
    private BlogMapper blogMapper;

    @Override
    public List<Blog> showsBlogs() {
        return blogMapper.showBlogs();
    }
    @Override
    public void addBlog(Blog blog){
         blogMapper.addBlog(blog);
    }

    @Override
    public void deleteBlog(long id) {
        blogMapper.deleteBlog(id);
    }

    @Override
    public void updateBlog(Blog blog) {
        blogMapper.updateBlog(blog);
    }

    @Override
    public Blog blogdetail(long id){
        blogMapper.blogdetail(id);
        return blogMapper.blogdetail(id);
    }




    @Override
    public GenericDao<Blog, Long> getDao() {
        return blogMapper;
    }
}
